package com.cyzy.service.impl;

import com.cyzy.mapper.ColumnMapper;
import com.cyzy.pojo.Column;
import com.cyzy.service.ColumnService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zxw
 * @create 2025-05-30 下午3:16
 */
@Service
public class ColumnServiceImpl implements ColumnService {
    @Autowired
    private ColumnMapper columnMapper;
    @Override
    public List<Column> getColumnList() {
        return columnMapper.selectList(null);
    }

    @Override
    public int updateColumn(Column column) {
        // 只更新排序和显隐状态
        Column updateColumn = new Column();
        updateColumn.setColumnId(column.getColumnId());
        updateColumn.setColumnSort(column.getColumnSort());
        updateColumn.setIsVisible(column.getIsVisible());
        return columnMapper.updateById(updateColumn);
    }
}
